package com.example.service;

import com.example.domain.User;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Li Cheng
 * @version 1.0
 * @date 2021/6/27 21:34
 */

@Transactional(readOnly = true)
public interface UserService {

        /**
         * 添加用户
         * @param user
         * @return
         */
        @Transactional(readOnly = false)
        public boolean save(User user);


        /**
         * 修改用户
         * @param user
         * @return
         */
        @Transactional(readOnly = false)
        public boolean update(User user);

        /**
         * 删除用户
         * @param user
         * @return
         */
        @Transactional(readOnly = false)
        public boolean delete(Integer id);

        /**
         * 查询用户
         * @param id
         * @return
         */
        public User get(Integer id);

        /**
         * 查询全部用户
         * @param
         * @return
         */
        public PageInfo<User> getAll(int page, int size);

        /**
         * 根据用户名密码查询用户信息
         * @param userName
         * @param password
         * @return
         */
        public User getByUserNameAndPassword(String name,String password);


}
